package com.xja.controller;

import com.xja.entity.Indent;
import com.xja.entity.Register;
import com.xja.entity.User;
import com.xja.entity.WorkPeople;
import com.xja.service.LwdService;
import com.xja.service.impl.LwdServiceImpl;

import java.util.List;

public class LwdController {
    LwdService lwdService=new LwdServiceImpl();
    public List<User> findAllUser(){
        return lwdService.findAllUser();
    }
    //查询用户是否存在
    public User findUserById(Integer id){
        return lwdService.findUserById(id);
    }
    //修改信息
    public Boolean updateUser(User user){
        return lwdService.updateUser(user);
    }
    //删除用户
    public Boolean deleUser(Integer id){
        return lwdService.deleUser(id);
    }
    //创建登记信息
    public Register createRegisterByUserId(Integer id){
        return lwdService.createRegisterByUserId(id);
    }
    //事务处理
    public boolean updateRegisterAndIndent(Register register){
        return lwdService.updateRegisterAndIndent(register);
    }
    public Indent findIndentById(Integer id){
        return lwdService.findIndentById(id);
    }
    //查询所有员工
    public List<WorkPeople> findAllWork(){
        return lwdService.findAllWork();
    }
    //根据id查员工
    public WorkPeople findWorkById(Integer id){
        return lwdService.findWorkById(id);
    }
    //修改员工信息
    public Boolean updateWork(WorkPeople workPeople){
        return lwdService.updateWork(workPeople);
    }
    public Boolean addWork(WorkPeople workPeople){
        return lwdService.addWork(workPeople);
    }
    public Boolean deleWork(Integer id){
        return lwdService.deleWork(id);
    }
}
